const obj = {
  isperson:true,
  running:function () {
    console.log('我是人我可以跑！');
  }
}

function createChild(name,friend) {
  let stu = Object.create(obj)
  stu.name = name
  stu.friend = friend
  stu.child = function () {
    console.log('我是子类，我会说话！');
  }
  return stu
}

const child1 = createChild('jinge1',["jinge1"])
const child2 = createChild("jinge2",["jinge2"])

console.log(child1);
console.log(child2);

// 缺点：方法不共享